UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JI5NQXW1v7X1PGyuJRJb/5LRfzs6kP1Fk7FSx7y/5l8='
WHERE
key_id = '60931fa1f8f9f01b17d8e93c9fa2b5ca05a21482c2f8d23dd74038ae5e77d055'
AND (
token = 'JI5NQXW1v7X1PGyuJRJb/5LRfzs6kP1Fk7FSx7y/5l8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)