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