UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZEdJCmmrwgrImBERRMRkX1dMTW/2gO6hmetxFiP5BJA='
WHERE
key_id = '4f546641596e0c29dcca84b65ab093c8b77ed4e6c826b5a203f417ccd17dfa6c'
AND (
token = 'ZEdJCmmrwgrImBERRMRkX1dMTW/2gO6hmetxFiP5BJA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)