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