UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6W3R6ySTc+BRfvfiWYvvQKqszHARUqvF0WPMsZx7BNo='
WHERE
key_id = 'dcb905b3007141d05a7389e32c5133c33312d18114699453dd5012d01198b4da'
AND (
token = '6W3R6ySTc+BRfvfiWYvvQKqszHARUqvF0WPMsZx7BNo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)