UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uLwblD8KQ+auVYK/wnAF47kK7BsmodmkoaO++ulrdxQ='
WHERE
key_id = '0ae28c9e97fa3352eca70de8045cae8e4421aa75660c38867187a8a897de4470'
AND (
token = 'uLwblD8KQ+auVYK/wnAF47kK7BsmodmkoaO++ulrdxQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)