UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'G+xRRHUZQsN7OaRCADfSNVewX1L18aYsnOaWlTnXrAQ='
WHERE
key_id = 'c95fdd030e2fab718549c1e1882dbe110a9d762bc0d8bf158ab367b623c69735'
AND (
token = 'G+xRRHUZQsN7OaRCADfSNVewX1L18aYsnOaWlTnXrAQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)