UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WjKqD1Be8xHayjH+G6TjyLKcXgqWXBoTZd6V7UQnHi4='
WHERE
key_id = '421779c8ea6dc4a236786a8eef009f7a51d4f493874869cb3170253a4c124ad3'
AND (
token = 'WjKqD1Be8xHayjH+G6TjyLKcXgqWXBoTZd6V7UQnHi4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)