UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Rmn6hJCbU+4qTlBs4x7Xovq+NJWzB11KA0U3QpaigsA='
WHERE
key_id = '5cfede6d4548957148ac9f6524deea0d58be644ef44772b646be2612dfecdb6a'
AND (
token = 'Rmn6hJCbU+4qTlBs4x7Xovq+NJWzB11KA0U3QpaigsA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)