UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IOOepAPxquJG6wZyO4fb2qmuB5I/udlbZvCyuyG8eTo='
WHERE
key_id = '04c8bd3657a8f46f7256336deece76af4ceef0875902bd554870dcae0e61e9a2'
AND (
token = 'IOOepAPxquJG6wZyO4fb2qmuB5I/udlbZvCyuyG8eTo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)