UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bRouhLpqg3BWpGzMH0MCQq9gIyK/R6/c7pCOaaBWBF4='
WHERE
key_id = 'cb99211c21af156a377aab6194413cf5561953c5982e32919abacec935c06d4d'
AND (
token = 'bRouhLpqg3BWpGzMH0MCQq9gIyK/R6/c7pCOaaBWBF4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)