UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oQXiHObtxqGorM+MebBrFR1OoHj9YGU4O1Hew1GPmZg=' 
WHERE 
  key_id = '2869b1b56232150887c28ac1dbf8e8c873aa5a215e3a77550a3547a881bd35b6' 
  AND (
    token = 'oQXiHObtxqGorM+MebBrFR1OoHj9YGU4O1Hew1GPmZg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033