UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yOmrZYMlUqaKkRQCiQewomIBKY02B7fp7Sk0tIE/fJA='
WHERE
key_id = 'b1f758c75301a25ebcbca7eea72f11c1b6810cc889f6193aba726b58cf6e00d0'
AND (
token = 'yOmrZYMlUqaKkRQCiQewomIBKY02B7fp7Sk0tIE/fJA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)