UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iEf/yUtCxzi/9mEDOurdd+HsNU/GDz0ehReeBXFFBKo='
WHERE
key_id = '6863ee3757692347215d8995fd85bae74047aa9c16ce574f530a32fbf390b1bf'
AND (
token = 'iEf/yUtCxzi/9mEDOurdd+HsNU/GDz0ehReeBXFFBKo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)