UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fZdR2fsb4SV3mitVIlzfE2sNLX1ajJ0YYqzCDmxocyE='
WHERE
key_id = '698d6b5e55352e62968912467cde84db5ab7e2cd2cbdb25bb2ea054dbdce0dc2'
AND (
token = 'fZdR2fsb4SV3mitVIlzfE2sNLX1ajJ0YYqzCDmxocyE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)