UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'b14XZEqU5HeuC8z+eBsxG5wvZo6xbRPyDdeithgWIkY='
WHERE
key_id = '7d8a0816f2f36bf6a10addded74a3a299b3602bd43a7e81a85dd786109fe051a'
AND (
token = 'b14XZEqU5HeuC8z+eBsxG5wvZo6xbRPyDdeithgWIkY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)