UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jRMOAg2xCvQ1/hwk7eHEQRoJTlfbAFwYIpQqfjqcyuo='
WHERE
key_id = 'c65fd939ad34f013a0a2770dfd6d1e572a56746770911247ac16c802585a7be3'
AND (
token = 'jRMOAg2xCvQ1/hwk7eHEQRoJTlfbAFwYIpQqfjqcyuo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)