UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'm6Wb4/pCIjEXkhCbnGTsH/IXX9s9ZrVMMjmUuHmSepc=' 
WHERE 
  key_id = '6f3b5933ea991dd15b8913f71293717d58393ce6ffe0dcfbe5f4dbb61fed67c8' 
  AND (
    token = 'm6Wb4/pCIjEXkhCbnGTsH/IXX9s9ZrVMMjmUuHmSepc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00274