UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TB2r/ZFO7jEpeVRMq8Hkyka6s2nCvvoT5QecgCBoHmk='
WHERE
key_id = '84ce9c92bcffe554c336a64ccfe56e72aa709d2f29e2016a26ea1194c07d4ec4'
AND (
token = 'TB2r/ZFO7jEpeVRMq8Hkyka6s2nCvvoT5QecgCBoHmk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)