UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZmPBvVvj1Qp3oUxiTHHNSbEEOZ1SpYMq79XAcVAEtLo='
WHERE
key_id = '9b201a1590cf8c751ff78ea87dd7fa9b8ad9b345fa8a6efcf5d21cccaf2a81e6'
AND (
token = 'ZmPBvVvj1Qp3oUxiTHHNSbEEOZ1SpYMq79XAcVAEtLo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)