UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mxQnpe25ljEtDNa+3lED9ny7dFw8S2o63zM4W6CJw8g='
WHERE
key_id = '5c8154ffd122e5e7397573f9db4e48451a01b2004aa7c3996f48bc53d3cb1802'
AND (
token = 'mxQnpe25ljEtDNa+3lED9ny7dFw8S2o63zM4W6CJw8g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)