UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cmSB0WKE2FrKofUknygZj2MOeZWfffOSOjPCMn2oLYs='
WHERE
key_id = '1e06915e0110333c2d7a079b5fb91254f1a5b568fa4abb5afae100ad9d401b5d'
AND (
token = 'cmSB0WKE2FrKofUknygZj2MOeZWfffOSOjPCMn2oLYs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)