UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TH/TSDsWGiRFRmo/Mp8x3rB8/sznHLwPEAsJ4ny0854='
WHERE
key_id = '8a06bce3c42f72ec5b1ea309cdc5e8ec24852466003562b375e3e7aa07e65c5e'
AND (
token = 'TH/TSDsWGiRFRmo/Mp8x3rB8/sznHLwPEAsJ4ny0854='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)