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