UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dlsAMf1dancpeZlpwq3PFIjUCfRX4hYhcKTsV2VMf68='
WHERE
key_id = '0914d0d6dd6872ffe7537f8aca9e3c2b8dad8b85732dd69e1a7bc4ebb40bf04d'
AND (
token = 'dlsAMf1dancpeZlpwq3PFIjUCfRX4hYhcKTsV2VMf68='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)