UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2vQcgBA6USHEFmFAqn94A3F573eFjT/bCytaQB0jFeA='
WHERE
key_id = '45b25c0b1bdc85c8ae428049a2b19896b755cbff63c9ee044c0a1d249e578a04'
AND (
token = '2vQcgBA6USHEFmFAqn94A3F573eFjT/bCytaQB0jFeA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)