UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XqLWE1aHPHajEG6PScrveFzZMwLu0NlmnRNpWuCdJ/k='
WHERE
key_id = '3144ad2b708e0b0b5c1c7c0363e5eb02bc62c7115b3852ae7904ec4fa1501252'
AND (
token = 'XqLWE1aHPHajEG6PScrveFzZMwLu0NlmnRNpWuCdJ/k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)