UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'g6NYvcCY/eQ5mAwmVYdVvqQkPNTEV2KVBR1n+bku8xQ='
WHERE
key_id = 'ceda7a6a36b40b5d30ddf7cef910a48271a93326b799987c7bfb4fb16e7d9c9a'
AND (
token = 'g6NYvcCY/eQ5mAwmVYdVvqQkPNTEV2KVBR1n+bku8xQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)