UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qT1xpmSLMkUGvtcfW8q+Ha1OZm+a1iPmavuFb93S8Yk='
WHERE
key_id = 'bc0335e04fa0034e424ba2797c81da6458f43f8ca982e11838cd342efbc7f196'
AND (
token = 'qT1xpmSLMkUGvtcfW8q+Ha1OZm+a1iPmavuFb93S8Yk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)