UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'H0GMEwQdWGVRmHaNWc3TaKmYIWjtKd501WgpCIzknB4='
WHERE
key_id = 'fea702f67124e7ab8b5fa83f57b01786bc091a4def79743da3beace696f105d2'
AND (
token = 'H0GMEwQdWGVRmHaNWc3TaKmYIWjtKd501WgpCIzknB4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)