UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Tc78n4o5aMEPlTRWNCnRkIYyVeimQm9e7CZWvPHcGUg='
WHERE
key_id = '9c97205483ad48c6bbd1b555141ed8913ce896ceb6c8c948db6146434a6c745e'
AND (
token = 'Tc78n4o5aMEPlTRWNCnRkIYyVeimQm9e7CZWvPHcGUg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)