UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7AHFyCUcqRabtvTJ8nAdaDrSfojT87Y3B1ziMBOhodQ='
WHERE
key_id = '7d35b201de763dad59509bb0f65f84b59d6b74a79010f85526da842082602390'
AND (
token = '7AHFyCUcqRabtvTJ8nAdaDrSfojT87Y3B1ziMBOhodQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)