UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XpePb4qlo5U0tt1vmWmNJINeGCkEp/c3UelrVO4ZT3A='
WHERE
key_id = '6b77702cf1690c1fab1ac86b4f3e57bc73f4a71cec88ca4de3f0638b75be4345'
AND (
token = 'XpePb4qlo5U0tt1vmWmNJINeGCkEp/c3UelrVO4ZT3A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)