UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aatVjsTzN6KVFZlcePQBfKHCsiWnod02hMBlzoi/0bA='
WHERE
key_id = '288235c98ece739c30c0e47110e49af0471c2ebd6a28d98e774a580ffd98a72a'
AND (
token = 'aatVjsTzN6KVFZlcePQBfKHCsiWnod02hMBlzoi/0bA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)