UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iLfo3Qv2cXPXyLiKe3csxdQ3LExApWR0gy/Bf4+55ss='
WHERE
key_id = '84f47c923e808d560c2d87f2b2e0d0a11ce12de77a940e2a3d583d1d2b6a0144'
AND (
token = 'iLfo3Qv2cXPXyLiKe3csxdQ3LExApWR0gy/Bf4+55ss='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)